<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: USB OTG Driver (OTG)</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">0.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">USB OTG Driver (OTG)</div>  </div>
<div class="ingroups"><a class="el" href="group__usb__group.html">USB Stack</a></div></div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="member-group"></a>
USBC IP properties</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp4ec4dc4c51d9d708aedf03b334b1cf86"></a> These macros give access to IP properties </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga276fd7e676117783fc8d3a45aeda3351">otg_get_ip_name</a>()&#160;&#160;&#160;(((uint64_t)AVR32_USBC.uname2&lt;&lt;32)|(uint64_t)AVR32_USBC.uname1)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get IP name part 1 or 2.  <a href="#ga276fd7e676117783fc8d3a45aeda3351"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga60eb9bc13cc48c77512db1849b54c4eb">otg_data_memory_barrier</a>()&#160;&#160;&#160;(AVR32_USBC.uvers)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Instruction to access at a peripheral register after interrupt clear, see AVR32002 - AVR32UC Technical reference $6.6 Memory barriers.  <a href="#ga60eb9bc13cc48c77512db1849b54c4eb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga44d71ccfd479392e4bbfd49057c4bf32">otg_get_ip_version</a>()&#160;&#160;&#160;(Rd_bitfield(AVR32_USBC.uvers, AVR32_USBC_UVERS_VERSION_NUM_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get IP version.  <a href="#ga44d71ccfd479392e4bbfd49057c4bf32"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga9ed10ed0cd9edede61a871d74b1d6859">otg_get_metal_fix_nbr</a>()&#160;&#160;&#160;(Rd_bitfield(AVR32_USBC.uvers, AVR32_USBC_UVERS_METAL_FIX_NUM_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get number of metal fixes.  <a href="#ga9ed10ed0cd9edede61a871d74b1d6859"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gadfdcbe969406b8f621bfd82699361e5c">otg_get_dpram_size</a>()&#160;&#160;&#160;(128 &lt;&lt; Rd_bitfield(AVR32_USBC.ufeatures, AVR32_USBC_UFEATURES_FIFO_MAX_SIZE_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get DPRAM size (FIFO maximal size) in bytes.  <a href="#gadfdcbe969406b8f621bfd82699361e5c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gac0da3ffdf225df7c33fef4f535147db0">Is_otg_dpram_byte_write_capable</a>()&#160;&#160;&#160;(Tst_bits(AVR32_USBC.ufeatures, AVR32_USBC_UFEATURES_BYTE_WRITE_DPRAM_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if DPRAM is natively byte write capable.  <a href="#gac0da3ffdf225df7c33fef4f535147db0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga00fe620dc8bbaa5707c691621f77321c">otg_get_ip_paddress_size</a>()&#160;&#160;&#160;(AVR32_USBC.uaddrsize)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get size of USBC PB address space.  <a href="#ga00fe620dc8bbaa5707c691621f77321c"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
USBC OTG ID pin management</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrp233477b48fb98e7cebdb297ab0a04a74"></a> These macros manage the ID pin use or not to switch between Host or Device mode </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394">OTG_ID_PIN</a>&#160;&#160;&#160;ATPASTE2(OTG_ID, _PIN)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Pin and function for USB_ID according to configuration from OTG_ID.  <a href="#ga1eac01e72e370946e44c6e372e77a394"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga67896e3d73053c7c3abfa5956dc47dbd">OTG_ID_FUNCTION</a>&#160;&#160;&#160;ATPASTE2(OTG_ID, _FUNCTION)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gaa8520a37f119fe71fa225da806595233">otg_input_id_pin</a>()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Input OTG_ID from its pin.  <a href="#gaa8520a37f119fe71fa225da806595233"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gaf5cc6e51a0bd88c118f63a999e7cf759">Is_otg_id_pin_input</a>()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if OTG_ID is input from its pin.  <a href="#gaf5cc6e51a0bd88c118f63a999e7cf759"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga8c345f8663b1f3432cb9882298e90a5b">otg_enable_id_pin</a>()&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable external OTG_ID pin (listened to by USB)  <a href="#ga8c345f8663b1f3432cb9882298e90a5b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga8ad60737541846833dbddf8e92828e40">otg_disable_id_pin</a>()&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable external OTG_ID pin (ignored by USB)  <a href="#ga8ad60737541846833dbddf8e92828e40"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga0c4344aeac9372eb1c455f23a844e1c8">Is_otg_id_pin_enabled</a>()&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if external OTG_ID pin enabled (listened to by USB)  <a href="#ga0c4344aeac9372eb1c455f23a844e1c8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga0a20b90b831ebf250983ef5e15f6d561">otg_force_device_mode</a>()&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK), otg_disable_id_pin())</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable external OTG_ID pin and force device mode.  <a href="#ga0a20b90b831ebf250983ef5e15f6d561"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gab9ff6cbcfe6c371a2cb9493c182fa6a8">Is_otg_device_mode_forced</a>()&#160;&#160;&#160;(!Is_otg_id_pin_enabled() &amp;&amp; Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if device mode is forced.  <a href="#gab9ff6cbcfe6c371a2cb9493c182fa6a8"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga7a96147ad9ff7531f799c5e2127efad1">otg_force_host_mode</a>()&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK), otg_disable_id_pin())</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable external OTG_ID pin and force host mode.  <a href="#ga7a96147ad9ff7531f799c5e2127efad1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga8d245cf2f27f09d9ae4dd6e68ef451eb">Is_otg_host_mode_forced</a>()&#160;&#160;&#160;(!Is_otg_id_pin_enabled() &amp;&amp; !Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if host mode is forced.  <a href="#ga8d245cf2f27f09d9ae4dd6e68ef451eb"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="member-group"></a>
USBC OTG ID pin interrupt management</h2></td></tr>
<tr><td class="ititle" colspan="2"><p><a class="anchor" id="amgrpb4d7c037f10d64941693e7f82d9338bc"></a> These macros manage the ID pin interrupt </p>
</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga873ba3797934aa55fdf0d179496e0e89">otg_enable_id_interrupt</a>()&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga88d47c2dfdbd1c720326b011db6a7ebd">otg_disable_id_interrupt</a>()&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gaee416d9364a73b24f67271cab0f697c5">Is_otg_id_interrupt_enabled</a>()&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga75ab090e520e22605a84c77048814e9a">Is_otg_id_device</a>()&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbsta, AVR32_USBC_USBSTA_ID_MASK))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga473adb587b33ff08bc9afa2a916087b0">otg_ack_id_transition</a>()&#160;&#160;&#160;(AVR32_USBC.usbstaclr = AVR32_USBC_USBSTACLR_IDTIC_MASK)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#ga221ed96e5450a2d29fdf265a99c430fc">otg_raise_id_transition</a>()&#160;&#160;&#160;(AVR32_USBC.usbstaset = AVR32_USBC_USBSTASET_IDTIS_MASK)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__otg__group.html#gad080cf4cce7110b5540021accd4e7f4c">Is_otg_id_transition</a>()&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbsta, AVR32_USBC_USBSTA_IDTI_MASK))</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>USBC low-level driver for OTG features</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Bit-masks are used instead of bit-fields because PB registers require 32-bit write accesses while AVR32-GCC 4.0.2 builds 8-bit accesses even when volatile unsigned int bit-fields are specified. </dd></dl>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gab9ff6cbcfe6c371a2cb9493c182fa6a8"></a><!-- doxytag: member="usbc_otg.h::Is_otg_device_mode_forced" ref="gab9ff6cbcfe6c371a2cb9493c182fa6a8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_device_mode_forced</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(!Is_otg_id_pin_enabled() &amp;&amp; Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if device mode is forced. </p>

</div>
</div>
<a class="anchor" id="gac0da3ffdf225df7c33fef4f535147db0"></a><!-- doxytag: member="usbc_otg.h::Is_otg_dpram_byte_write_capable" ref="gac0da3ffdf225df7c33fef4f535147db0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_dpram_byte_write_capable</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Tst_bits(AVR32_USBC.ufeatures, AVR32_USBC_UFEATURES_BYTE_WRITE_DPRAM_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if DPRAM is natively byte write capable. </p>

</div>
</div>
<a class="anchor" id="ga8d245cf2f27f09d9ae4dd6e68ef451eb"></a><!-- doxytag: member="usbc_otg.h::Is_otg_host_mode_forced" ref="ga8d245cf2f27f09d9ae4dd6e68ef451eb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_host_mode_forced</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(!Is_otg_id_pin_enabled() &amp;&amp; !Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if host mode is forced. </p>

</div>
</div>
<a class="anchor" id="ga75ab090e520e22605a84c77048814e9a"></a><!-- doxytag: member="usbc_otg.h::Is_otg_id_device" ref="ga75ab090e520e22605a84c77048814e9a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_id_device</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbsta, AVR32_USBC_USBSTA_ID_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="gaee416d9364a73b24f67271cab0f697c5"></a><!-- doxytag: member="usbc_otg.h::Is_otg_id_interrupt_enabled" ref="gaee416d9364a73b24f67271cab0f697c5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_id_interrupt_enabled</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga0c4344aeac9372eb1c455f23a844e1c8"></a><!-- doxytag: member="usbc_otg.h::Is_otg_id_pin_enabled" ref="ga0c4344aeac9372eb1c455f23a844e1c8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_id_pin_enabled</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if external OTG_ID pin enabled (listened to by USB) </p>

</div>
</div>
<a class="anchor" id="gaf5cc6e51a0bd88c118f63a999e7cf759"></a><!-- doxytag: member="usbc_otg.h::Is_otg_id_pin_input" ref="gaf5cc6e51a0bd88c118f63a999e7cf759" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_id_pin_input</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">( !Tst_bits(AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].gper, 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)) &amp;&amp;\
               Tst_bits(AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr0, 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)) == Tst_bits(<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a>, 0x01) &amp;&amp;\
               Tst_bits(AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr1, 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)) == Tst_bits(<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a>, 0x02))
</pre></div>
<p>Test if OTG_ID is input from its pin. </p>

</div>
</div>
<a class="anchor" id="gad080cf4cce7110b5540021accd4e7f4c"></a><!-- doxytag: member="usbc_otg.h::Is_otg_id_transition" ref="gad080cf4cce7110b5540021accd4e7f4c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Is_otg_id_transition</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Tst_bits(AVR32_USBC.usbsta, AVR32_USBC_USBSTA_IDTI_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga473adb587b33ff08bc9afa2a916087b0"></a><!-- doxytag: member="usbc_otg.h::otg_ack_id_transition" ref="ga473adb587b33ff08bc9afa2a916087b0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_ack_id_transition</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(AVR32_USBC.usbstaclr = AVR32_USBC_USBSTACLR_IDTIC_MASK)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga60eb9bc13cc48c77512db1849b54c4eb"></a><!-- doxytag: member="usbc_otg.h::otg_data_memory_barrier" ref="ga60eb9bc13cc48c77512db1849b54c4eb" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_data_memory_barrier</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(AVR32_USBC.uvers)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Instruction to access at a peripheral register after interrupt clear, see AVR32002 - AVR32UC Technical reference $6.6 Memory barriers. </p>

</div>
</div>
<a class="anchor" id="ga88d47c2dfdbd1c720326b011db6a7ebd"></a><!-- doxytag: member="usbc_otg.h::otg_disable_id_interrupt" ref="ga88d47c2dfdbd1c720326b011db6a7ebd" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_disable_id_interrupt</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga8ad60737541846833dbddf8e92828e40"></a><!-- doxytag: member="usbc_otg.h::otg_disable_id_pin" ref="ga8ad60737541846833dbddf8e92828e40" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_disable_id_pin</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disable external OTG_ID pin (ignored by USB) </p>

</div>
</div>
<a class="anchor" id="ga873ba3797934aa55fdf0d179496e0e89"></a><!-- doxytag: member="usbc_otg.h::otg_enable_id_interrupt" ref="ga873ba3797934aa55fdf0d179496e0e89" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_enable_id_interrupt</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_IDTE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga8c345f8663b1f3432cb9882298e90a5b"></a><!-- doxytag: member="usbc_otg.h::otg_enable_id_pin" ref="ga8c345f8663b1f3432cb9882298e90a5b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_enable_id_pin</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIDE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Enable external OTG_ID pin (listened to by USB) </p>

</div>
</div>
<a class="anchor" id="ga0a20b90b831ebf250983ef5e15f6d561"></a><!-- doxytag: member="usbc_otg.h::otg_force_device_mode" ref="ga0a20b90b831ebf250983ef5e15f6d561" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_force_device_mode</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Set_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK), otg_disable_id_pin())</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disable external OTG_ID pin and force device mode. </p>

</div>
</div>
<a class="anchor" id="ga7a96147ad9ff7531f799c5e2127efad1"></a><!-- doxytag: member="usbc_otg.h::otg_force_host_mode" ref="ga7a96147ad9ff7531f799c5e2127efad1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_force_host_mode</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Clr_bits(AVR32_USBC.usbcon, AVR32_USBC_USBCON_UIMOD_MASK), otg_disable_id_pin())</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Disable external OTG_ID pin and force host mode. </p>

</div>
</div>
<a class="anchor" id="gadfdcbe969406b8f621bfd82699361e5c"></a><!-- doxytag: member="usbc_otg.h::otg_get_dpram_size" ref="gadfdcbe969406b8f621bfd82699361e5c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_get_dpram_size</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(128 &lt;&lt; Rd_bitfield(AVR32_USBC.ufeatures, AVR32_USBC_UFEATURES_FIFO_MAX_SIZE_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get DPRAM size (FIFO maximal size) in bytes. </p>

</div>
</div>
<a class="anchor" id="ga276fd7e676117783fc8d3a45aeda3351"></a><!-- doxytag: member="usbc_otg.h::otg_get_ip_name" ref="ga276fd7e676117783fc8d3a45aeda3351" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_get_ip_name</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(((uint64_t)AVR32_USBC.uname2&lt;&lt;32)|(uint64_t)AVR32_USBC.uname1)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get IP name part 1 or 2. </p>

</div>
</div>
<a class="anchor" id="ga00fe620dc8bbaa5707c691621f77321c"></a><!-- doxytag: member="usbc_otg.h::otg_get_ip_paddress_size" ref="ga00fe620dc8bbaa5707c691621f77321c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_get_ip_paddress_size</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(AVR32_USBC.uaddrsize)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get size of USBC PB address space. </p>

</div>
</div>
<a class="anchor" id="ga44d71ccfd479392e4bbfd49057c4bf32"></a><!-- doxytag: member="usbc_otg.h::otg_get_ip_version" ref="ga44d71ccfd479392e4bbfd49057c4bf32" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_get_ip_version</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Rd_bitfield(AVR32_USBC.uvers, AVR32_USBC_UVERS_VERSION_NUM_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get IP version. </p>

</div>
</div>
<a class="anchor" id="ga9ed10ed0cd9edede61a871d74b1d6859"></a><!-- doxytag: member="usbc_otg.h::otg_get_metal_fix_nbr" ref="ga9ed10ed0cd9edede61a871d74b1d6859" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_get_metal_fix_nbr</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(Rd_bitfield(AVR32_USBC.uvers, AVR32_USBC_UVERS_METAL_FIX_NUM_MASK))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get number of metal fixes. </p>

</div>
</div>
<a class="anchor" id="ga67896e3d73053c7c3abfa5956dc47dbd"></a><!-- doxytag: member="usbc_otg.h::OTG_ID_FUNCTION" ref="ga67896e3d73053c7c3abfa5956dc47dbd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OTG_ID_FUNCTION&#160;&#160;&#160;ATPASTE2(OTG_ID, _FUNCTION)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ga1eac01e72e370946e44c6e372e77a394"></a><!-- doxytag: member="usbc_otg.h::OTG_ID_PIN" ref="ga1eac01e72e370946e44c6e372e77a394" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define OTG_ID_PIN&#160;&#160;&#160;ATPASTE2(OTG_ID, _PIN)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Pin and function for USB_ID according to configuration from OTG_ID. </p>

</div>
</div>
<a class="anchor" id="gaa8520a37f119fe71fa225da806595233"></a><!-- doxytag: member="usbc_otg.h::otg_input_id_pin" ref="gaa8520a37f119fe71fa225da806595233" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_input_id_pin</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment">{\
   (Tst_bits(<a class="code" href="group__otg__group.html#ga67896e3d73053c7c3abfa5956dc47dbd">OTG_ID_FUNCTION</a>, 0x01)) ?\
      (AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr0s = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)) :\
      (AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr0c = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)); \
   (Tst_bits(<a class="code" href="group__otg__group.html#ga67896e3d73053c7c3abfa5956dc47dbd">OTG_ID_FUNCTION</a>, 0x02)) ?\
      (AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr1s = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)) :\
      (AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].pmr1c = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F)); \
   AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].gperc = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F);\
   AVR32_GPIO.port[<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &gt;&gt; 5].puers = 1 &lt;&lt; (<a class="code" href="group__otg__group.html#ga1eac01e72e370946e44c6e372e77a394" title="Pin and function for USB_ID according to configuration from OTG_ID.">OTG_ID_PIN</a> &amp; 0x1F);\
}
</pre></div>
<p>Input OTG_ID from its pin. </p>

</div>
</div>
<a class="anchor" id="ga221ed96e5450a2d29fdf265a99c430fc"></a><!-- doxytag: member="usbc_otg.h::otg_raise_id_transition" ref="ga221ed96e5450a2d29fdf265a99c430fc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define otg_raise_id_transition</td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td>&#160;&#160;&#160;(AVR32_USBC.usbstaset = AVR32_USBC_USBSTASET_IDTIS_MASK)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Mon Dec 19 2011 21:04:54 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
